/*
 * heap_sort.c
 *
 *  Created on: Mar 25, 2014
 *      Author: jack
 */
#include<stdio.h>

void insert_sort(int arr[],int len)
{
    int i,j;
    for(i=0; i<len; i++)
    {
        int tmp = arr[i];
        for(j=i-1; j>=0; j--)
        {
            if(tmp<arr[j]) {
                arr[j+1]=arr[j];
            } else {
                break;
            }
        }
        arr[j+1]=tmp;
    }
}
